package com.youkeyi.ddy.cloud.common.api.basic.pub.server;

import com.youkeyi.ddy.cloud.common.api.basic.pub.server.dto.PublicServerListCloudDto;
import com.youkeyi.ddy.cloud.common.api.basic.pub.server.dto.PublicServerTreeItemCloudDto;
import com.youkeyi.ddy.cloud.common.api.basic.pub.server.param.*;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * PublicServerCloudService
 *
 * @Author liuxiawang
 * @Date 2024/2/19 2:31 PM
 * @Location shenzhen.china
 */
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-BASIC-PUBLIC", fallback = PublicServerCloudServiceFallback.class)
@RequestMapping("/public/server")
public interface PublicServerCloudService {

    /**
     * 查询服务列表.
     *
     * @param param the param
     * @return the server list cloud dto
     */
    @PostMapping(value = "/query")
    public abstract PublicServerListCloudDto query(@RequestBody PublicServerQueryCloudParam param);

    /**
     * 查询服务列表.
     *
     * @param param the param
     * @return the server list cloud dto
     */
    @PostMapping(value = "/query/tree")
    public abstract List<PublicServerTreeItemCloudDto> queryTree(@RequestBody PublicServerQueryTreeCloudParam param);

    /**
     * 新增服务.
     *
     * @param param the param
     * @return the response content
     */
    @PostMapping(value = "/create")
    public abstract ResponseContent create(@RequestBody PublicServerCreateCloudParam param);

    /**
     * 编辑服务.
     *
     * @param param the param
     * @return the response content
     */
    @PostMapping(value = "/update")
    public abstract ResponseContent update(@RequestBody PublicServerUpdateCloudParam param);

    /**
     * 删除服务.
     *
     * @param param the param
     * @return the response content
     */
    @PostMapping(value = "/delete")
    public abstract ResponseContent delete(@RequestBody PublicServerDeleteCloudParam param);
}
